// @ts-ignore

/* eslint-disable */
import { request } from 'umi';

/** 查询两个企业间的控制路径 GET /api/controlPath 
 * @param params entityA, entityB, dateFrom, dateTo, ts
*/
export async function getControlPath(params, options) {
    // console.log(params, options)
    return request('/api/ep/controlPath', {
        method: 'GET',
        params: { ...params },
        ...(options || {}),
    });
}

/** 查询一个企业间的控制或者从属的控制权网络 GET /api/controlNetwork 
 * @param params centerId, level, direction, dateFrom, dateTo, ts
*/
export async function getControlNetwork(params, options) {
    // console.log(params, options)
    return request('/api/ep/controlNetwork', {
        method: 'GET',
        params: { ...params },
        ...(options || {}),
    });
}

/** 查询一个企业是否属于某个资本系，返回这个资本系的名称 GET /api/capital 
 * @param params id, date, ts
*/
export async function getCapitalName(params, options) {
    // console.log(params, options)
    return request('/api/capital/', {
        method: 'GET',
        params: { ...params },
        ...(options || {}),
    });
}

/** 查询某个资本系的网络结构, GET /api/capital:capitalName 
 * @param params capitalName, date, ts
*/
export async function getCapitalNetwork(params, options) {
    console.log(params, options)
    const { capitalName } = params
    return request('/api/capital/' + capitalName, {
        method: 'GET',
        params: { ...params },
        ...(options || {}),
    });
}